<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="perm" uri="/WEB-INF/tld/perm.tld"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
	<script>var ctx="${ctx}";</script>
	<head>
	    <meta charset="utf-8">
	    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <title>评论管理</title>
	    <meta name="keywords" content="体验,友好,高级管理台,易用,高性能,高扩展性,bootstrap框架,响应式后台">
	    <meta name="description" content="这是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
	    <meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
		<meta http-equiv="expires" content="Wed, 26 Feb 209908:21:57 GMT"> 
	    
		<link rel="shortcut icon" href="favicon.ico"> 
		<link href="${ctx}/static/css/bootstrap.min.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/font-awesome.min.css?v=4.4.0?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/plugins/footable/footable.core.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/plugins/summernote/summernote.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/plugins/summernote/summernote-bs3.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/plugins/laypage/laypage.css?v=${static_version}"  rel="stylesheet">
		<link href="${ctx}/static/css/plugins/iCheck/custom.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/plugins/chosen/chosen.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/animate.min.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/js/plugins/layer/laydate/laydate.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/plugins/webuploader/webuploader.css?v=${static_version}/" rel="stylesheet">
		<link href="${ctx}/static/css/style.min.css?v=${static_version}/" rel="stylesheet">
	    
	</head>
	<body class="gray-bg">
    	<div class="ibox float-e-margins">
    		<div class="ibox-content">
                <form class="form-group" id="comment_table_form">
                    <input type="hidden" name="connId" value="${id}">	
                	<input type="hidden" name="orderBy" value="create_date desc">
                	<input type="hidden" id="comment-select-id" name="comment-select" value="">
                	<div class="row">
                		<perm:hasPermission code="comment/find">
                        <div class="col-md-2"><input name="keyword" type="text" placeholder="请输用户昵称" class="form-control" /></div>
		     	  		<div class="col-md-4">
                            <div class="input-daterange input-group">
                                <input id="startTime" type="text" class="input-md form-control layer-date" placeholder="开始时间"  name="startTime">
					        	<span class="input-group-addon">至</span>
					        	<input id="endTime" type="text" class="input-md form-control layer-date" placeholder="结束时间"  name="endTime">
                            </div>
					    </div>
						<div class="col-md-1 col-sm-2">
							<button id="comment_table_search" type="button" class="btn btn-outline btn-block btn-primary">查询</button>
						</div>
						</perm:hasPermission>
						
                    </div>
                </form>
				<table id="comment_table" data-action="${ctx}/comment/find" data-datatable="true"  class="footable table table-stripped toggle-arrow-tiny">
				  	<thead>
					  	<tr>
<!-- 							<th data-sort-ignore="true"  data-title="connId" >留言id</th> -->
<!-- 							<th data-sort-ignore="true"  data-title="type"  data-type="enum" data-opt='{"1":"新品","2":"资讯","3":"广告"}'>类型</th> -->
<!-- 							<th data-sort-ignore="true"  data-title="type"  data-hide="phone,tablet">1：新品；2：咨询；3：广告</th> -->
							<th data-sort-ignore="true"  data-title="nickName" >会员昵称</th>
							<th data-sort-ignore="true"  data-title="content" >内容</th>
							<th data-sort-ignore="true"  data-title="createDate" data-type="datetime" data-hide="phone,tablet">评价时间</th>
					  	</tr>
				  	</thead>
				  	<tbody>
				  	</tbody>
			  	</table>
			  	<div class="row">
			  		<div class="col-md-6" class="pull-left" id="page_left_text"></div>
			  		<div class="col-md-6"  id="page_text"></div>
			  	</div>
			</div>
		</div>
		
	<script src="${ctx}/static/js/jquery.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/bootstrap.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/footable/footable.all.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/validate/jquery.validate.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/validate/messages_zh.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/webuploader/webuploader.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/summernote/summernote.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/summernote/summernote-zh-CN.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/chosen/chosen.jquery.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/layer/laydate/laydate.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/iCheck/icheck.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/plugins/laypage/laypage.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/switchery/switchery.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/eModal.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/cookie.js?v=?v=${static_version}"></script>
	<script src="${ctx}/static/common/custom-datatable.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/content.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/contabs.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/common/common.js?v=${static_version}"></script>
	
	<script>
		$(document).ready(function() {
			init_page_datatable();
		});
		
// 		var clickUpdateGet=function(me){
// 			eModal.ajax({
// 	   	        url: "${ctx}/comment/updateGet?id="+$(me).data("id"),
// 	   	        title:'修改评论',
// 	   	        loading:true,
// 	   	        subtitle: '',
// 	   	        buttons: [
// 	   	            {text:'保存',style:'info',close:false,click:function(){
// 	   	 		    	$.ajax({  
// 	   	 					url:'${ctx}/comment/update',  
// 	   	 					data:{
// 								connId:$("#connId").val(),							
// 								type:$("#type").val(),							
// 								content:$("#content").val(),							
// 								createDate:$("#createDate").val(),							
// 								id:$("#id").val(),							
// 								memberId:$("#memberId").val()
// 							},   
// 							type: 'POST',
// 	   	 					dataType:'json',  
// 	   	 					success:function(response){
// 	   	 						if(response.code==0){
// 	   	 							eModal.close();
// 	   	 							$("#comment_table_search").click();
// 	   	 						}else{
// 	   	 						    $.confirm({cancelButton: "关   闭",title: '提示!',content: "修改评论错误!"});
// 	   	 						}
// 	   	 					}  
// 	   	 			    }); 
// 	   	            }},{text: '取消', style: 'danger', close: false, click:function(){
// 	   	            	eModal.close();
// 	   	            }}
// 	   	        ],
// 	   	    });
// 		}

		$(function(){
		
			jQuery.searchFormInit();
		    
		    $.ajax({  
				url:'${ctx}/announce/list',  		 					
				type: 'POST',
				dataType:'json',  
				success:function(response){
					if(response.code==0){
						var html=[];
						var data=response.data||[];
						for(var i=0;i<data.length;i++){
							html.push('<option value="'+data[i].id+'">'+data[i].name+'</option>');
						}
						$("#typeIds").append(html.join(""));
						$("#typeIds").trigger("chosen:updated");
					}
				 }  
		     });
			
			 $("#typeIds").chosen({width:'100%'}).change(function(event) {
				$("#announce-select-id").val($(event.target).val());
			 });
		    
		});

	</script>
	
	</body>
</html>